<?php
/**
 * Description
 *
 * PHP version 7
 *
 * @category Custom
 * @package  Custom
 * @author   ryu <mo5467@126.com>
 * @date     2020-04-22 23:58:51
 * @lastTime 2020-05-01 23:19:55
 * @license  https://opensource.org/licenses/MIT MIT License
 * @link     none
 */

namespace Design\Creational\Builder;

use Design\Creational\Builder\Parts\Door;
use Design\Creational\Builder\Parts\Truck;
use Design\Creational\Builder\Parts\Wheel;
use Design\Creational\Builder\Parts\Engine;
use Design\Creational\Builder\Parts\Vehicle;

class TruckBuilder implements Builder
{

    private $truck;


    public function createVehicle()
    {
        $this->truck = new Truck();

    }//end createVehicle()


    public function addDoors()
    {
        $this->truck->setPart('leftDoor', new Door());
        $this->truck->setPart('rightDoor', new Door());

    }//end addDoors()


    public function addEngine()
    {
        $this->truck->setPart('engine', new Engine());

    }//end addEngine()


    public function addWheel()
    {
        $this->truck->setPart('wheel1', new Wheel());
        $this->truck->setPart('wheel2', new Wheel());
        $this->truck->setPart('wheel3', new Wheel());
        $this->truck->setPart('wheel4', new Wheel());

    }//end addWheel()


    public function getVehicle()
    {
        return $this->truck;

    }//end getVehicle()


}//end class
